1. Field of the Invention
The present invention relates to a document editing apparatus for causing a computer to create and edit a document of a type having a structure, and more particularly to an apparatus for creating and editing a structured document that is written in a standard generalized markup language.
2. Related Background Art
Apparatuses for creating and editing a structured document described in the standard generalized markup language (SGML (ISO-8879) has been developed. A structured document editing apparatus of the foregoing type has an arrangement that a document type is previously set and the document adaptable to the document type is made.
FIG. 67 illustrates a case where a document type is written in the standard generalized markup language by a document editing apparatus of the foregoing type. The operation of describing the document type is performed such that the structure of a document is defined as follows.
A document basically comprises a document element of a type "book". Hereinafter a document element of a type "x" is expressed as document element "x". The content of the document element "book" is composed of document element "fm" and document element "bdy" disposed in this order. The document element "fm" contains a leading document element "ti" and zero or more document elements "au" or "cau".
The document element "ti" contains a character string. Descriptions of the other structures of the document elements are omitted.
FIG. 68 illustrates the structure of a document editing apparatus which is capable of editing a structured document of the foregoing type.
Referring to FIG. 68, reference numeral 1 represents a keyboard, 2 represents a pointing device such as a mouse, 3 represents a CPU, 4 represents a CRT, 10 represents a storage unit for storing programs, 20 represents a sub-storage unit for permanently storing programs and data items, and 30 represents a storage unit for storing data. The foregoing units are connected to one another through a bus 9. Note that the storage units 10 and 30 and the sub-storage unit 20 that are used individually may be used as program and data storage units.
FIGS. 69 and 70 illustrate examples where the document adapted to the document type shown in FIG. 67 is described in the standard generalized markup language. The documents shown in FIGS. 69 and 70 are different from each other in terms of the author of the document that is a person expressed by document element "au" and that is a corporation expressed by document element "cau".
When the structured document is edited, a SGML original document 21 processed as a file in the sub-storage unit 20 and described in the standard generalized markup language is read, converted into an internal data format so that the SGML original document 21 is stored in the storage unit 30 as document data 31. The document data 31 is edited and converted into the description format of the standard generalized markup language and written over the SGML original document 21 so that the SGML original document 21 is updated. As an alternative to the conversion into the description format of the standard generalized markup language, a copy of the document data 31 may be stored as stored document data 22 that is a file in the sub-storage unit 20 while maintaining the internal format.
FIG. 71 illustrates an example of a display created on a screen of the conventional structured document editing apparatus immediately before the document element indicating the author is inserted.
Referring to FIG. 71, reference numeral 101 represents an insertion cursor that indicates a position at which a document element is inserted, the cursor movement being enabled by the pointing device 2 or a cursor moving key of the keyboard 1. The event initiated to occur by the pointing device 2 or the cursor moving key results in a document element appointing program 11 being executed so that the position in the document data 31 and that of the cursor on the screen are changed.
The document data is as shown in FIG. 72 at the foregoing moment.
FIG. 72 illustrates the structure of data in the document data 31 shown in FIG. 68. As shown in FIG. 72, the document data 31 is formed in a tree network expressing a nested structure comprising document elements 3101 and 3102 as nodes. A base document element 3101, which is the content of the document, is pointed to by a root pointer 3100 for pointing to the content of a document.
Each document element contains data representing the type of the document element, link data representing the order relationship of the element and content data representing the content of the document element.
The document element 3101, which is an element of the root, has the identifier "book". Its link data indicates no link and content data is pointed to the document element 3102. The reason why no link is present is that the base of the document is composed of only one document element 3101.
The type of the document element 3102 is "fm" and the document element 3102 has link data that points the document element 3103. This expresses a fact that the content of the document element 3101 are composed of the document element "fm" 3102 and the document element "bdy" 3103 which are arranged in this order.
A document element 3105 pointed to as the content of the document element "ti" 3104 is a character string that is distinguished by the type identifier "#". Note that the content directly comprises a character string "ABCDEF". When a document element insertion command is executed by, for example, selecting a menu on the operation screen, a document element insertion program 12 (FIG. 68) is executed.
FIG. 73 is a flow chart of the document element insertion process to be performed by a document editing apparatus of the foregoing type, where (1) to (4) are indicative of the steps of the process.
An assumption is made that the document portion appointment is in a state where a position next to the document element "ti" is appointed as a subject to be processed. That is, a position next to the first element of the content of the document element "fm" is the subject to be processed.
In step (1) document elements that can be included in the appointed document portion are listed as follows: in accordance with the definition of the type of the document element containing the appointed portion as the content, a document element that is permitted to appear in the foregoing portion is determined.
In this example, the type of the document element having, as the content thereof, the appointed portion is "fm". Furthermore, the appointed portion is positioned immediately in the rear of the document element "ti". Therefore, the definition of the document type shown in FIG. 67 results in the probable document element being the document element "au" or the document element "cau". Thus, the foregoing document elements are listed.
In step (2) an insertion enabled document element is displayed on a dialogue window 102 to cause an operator to select one document element. An example of the operation screen at this time is shown in FIG. 74.
FIG. 74 illustrates an example of display for selecting a document element on the document editing apparatus shown in FIG. 68.
When an editor selects a document element and clicks a selection button 103, the operation proceeds to step (3) to insert the selected document element into a portion of the selected document data. If the editor selects the document element "rau", a document element 3106 is created which is then inserted into a position next to the document element 3104. Thus, the structure of the document data is updated as shown in FIG. 75.
FIG. 75 illustrates a process performed by the document editing apparatus shown in FIG. 68 for updating the structure of document data.
The appointment of the document portion is updated immediately after the inserted document element.
Then, the updated document data is shaped and again displayed in step (4). An example of display of the thus-updated document on the operation screen is shown in FIG. 76.
FIG. 76 illustrates an example of a screen of the document editing apparatus after a document element has been selected.
The operation of the document editing apparatus for processing a structured document will now be described.
When the structured document editing apparatus is started and the type of the document to be processed is selected from the menu, for example, the document type "book" is selected, and a display as shown in FIG. 79 is created.
FIG. 79 illustrates an example of the operation screen when the structured document is processed by the document editing apparatus.
Referring to FIG. 79, reference numeral 401 represents a graphic cursor that is controlled by the mouse 2 (FIG. 68). Reference numeral 402 represents an insertion cursor that indicates a present insertion point. The insertion cursor 402 can be moved by using the mouse 2 or the cursor moving key of the keyboard 1.
The event initiated to occur by the mouse 2 or the cursor moving key executes the document element portion appointing program 11 so that the corresponding position in the document data 31 and that of the cursor on the operation screen are updated.
Reference numerals 403 and 404 represent start and end symbols of the document element that correspond to start and end tags of the SGML original document. At this time, the document data 31 is as shown in FIG. 80.
FIG. 80 illustrates the structure of the document data in the document editing apparatus of the foregoing type.
When the insertion cursor 402 is positioned at the position shown in FIG. 79, that is, when the content is included in the empty document element "book", execution of the document element insertion command performed by selecting the menu on the operation screen causes the document element insertion program 12 to be executed. Then, the process shown in the flow chart shown in FIG. 73 is repeated so that processing of the structured document is completed.
When the processed or edited document is saved, the document data 31 is converted into the description format of the standard generalized markup language and the converted data is transmitted to the sub-storage unit 20 as a SGML original document 21.
As an alternative to the conversion into the description format of the standard generalized markup language, data in the internal format is sometimes transmitted to the substorage unit 20 as document data 22 to be stored.
Documents in specific formats can be processed more efficiently on the basis of a template as compared with processing it in a blank state. The template is prepared by previously including fixed documents together with structure information.
When document data is prepared to form the data structure as shown in FIG. 77, a screen as shown in FIG. 78 is displayed when document processing has been started.
When the skeleton of the document is previously displayed, facts that the title of the document is determined to be "ABCDEF" and that the title of the chapter must be described are indicated by the leading symbol 105 and the final symbol 106 of the document element "ct" 3107.
As for the author, the selection permitted such that a person or a corporation can be selectively registered as the author results in that the symbols indicating the document elements cannot be displayed previously. Therefore, use of the template of a document raises a problem that information can be undesirably excluded from entry.
In order to overcome the problem, it might be considered feasible to previously prepare a plurality of development patterns.
However, if the development patterns to be prepared previously are automatically processed from the data that describes the structure in the SGML format shown in FIG. 67, a multiplicity of patterns except the development pattern intended to be processed by a user are processed simultaneously. Thus, an excessive amount of time and a large memory are required, so that the operation cannot be completed efficiently.